package com.sz.stock.client;

import com.sz.stock.common.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "stock-market", fallback = MarketClientImpl.class)
public interface MarketClient {
    @RequestMapping(value = "/stock/test", method = RequestMethod.POST)
    ResultBean testService();

    @RequestMapping(value = "/stock/testparam", method = RequestMethod.POST)
    ResultBean testparamService(@RequestParam(value = "name", required = false) String name, @RequestParam(value = "pwd", required = false) String pwd);

    //获取一支股票信息
    @RequestMapping(value = "/stock/getStock", method = RequestMethod.POST)
    ResultBean getStock(@RequestBody String code);

    //获取一支股票的 高开低收 即 最新价格
    @RequestMapping(value = "/stock/getOneOhcl", method = RequestMethod.POST)
    ResultBean getOneOhcl(@RequestBody String code);

    //查询一支股票的 涨跌停价格
    @RequestMapping(value = "/stock/getOneStopPoint", method = RequestMethod.POST)
    ResultBean getOneStopPoint(@RequestBody String code);

    @RequestMapping("/stock/getMarketData")
    ResultBean getMarketData(@RequestParam("code")String code, @RequestParam("scale")String scale,@RequestParam("datalen")  String datalen);

    @RequestMapping("/stock/getAllStock")
    ResultBean getAllStock();
    @RequestMapping(value = "/stock/pageInit",method = RequestMethod.POST)
    ResultBean pageInit(@RequestParam(value = "stockCode",required = false) String stockCode);

    @RequestMapping(value = "/stock/getprices",method = RequestMethod.POST)
    ResultBean getPrices();

    @RequestMapping(value = "/stock/getMarketPrice",method = RequestMethod.POST)
    ResultBean getMarketPrice();

}
